import {{{invokerPackage}}}.ApiClient;
import {{{invokerPackage}}}.ApiException;
import {{{invokerPackage}}}.ApiResponse;
import {{{invokerPackage}}}.{{clientName}};
import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}}
import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}}
import {{{invokerPackage}}}.model.*;
import {{{package}}}.{{{classname}}};
import java.util.List;
import java.util.Map;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    {{> libraries/okhttp-gson/api_doc_setup}}
    {{#requiredParamsWithRequestBodyProperties}}
    {{{dataType}}} {{{paramName}}} = {{{example}}};{{#description}} // {{{.}}}{{/description}}
    {{/requiredParamsWithRequestBodyProperties}}
    {{#optionalParamsWithRequestBodyProperties}}
    {{{dataType}}} {{{paramName}}} = {{{example}}};{{#description}} // {{{.}}}{{/description}}
    {{/optionalParamsWithRequestBodyProperties}}
    try {
      {{> libraries/okhttp-gson/api_doc_example_call}}{{#returnModel}}
      System.out.println(result);{{^returnProperty.isArray}}{{#vars}}
      System.out.println(result.{{{getter}}}());{{/vars}}{{/returnProperty.isArray}}{{/returnModel}}
    } catch (ApiException e) {
      System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
      System.err.println("Status code: " + e.getStatusCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }

    // Use .executeWithHttpInfo() to retrieve HTTP Status Code, Headers and Request
    try {
      {{#returnType}}ApiResponse<{{{.}}}> response = {{/returnType}}client
              .{{classNameCamelCase}}
              .{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParamsWithRequestBodyProperties}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParamsWithRequestBodyProperties}}){{#optionalParamsWithRequestBodyProperties}}
              .{{{paramName}}}({{{paramName}}}){{/optionalParamsWithRequestBodyProperties}}
              .executeWithHttpInfo();{{/vendorExtensions.x-group-parameters}}{{#returnType}}
      System.out.println(response.getResponseBody());
      System.out.println(response.getResponseHeaders());
      System.out.println(response.getStatusCode());
      System.out.println(response.getRoundTripTime());
      System.out.println(response.getRequest());{{/returnType}}
    } catch (ApiException e) {
      System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
      System.err.println("Status code: " + e.getStatusCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
